<!DOCTYPE html>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<html class="win-frame">
<head>
<title>${name_china}管理-编辑${name_china}</title>
<%@include file="/common/head.jsp" %>

</head>
<body class="iframe-page">
<div class="page-title-wrapper">
    <div class="page-title">
        <div class="page-title-text">
            <span>${name_china}管理</span>
            <span class="split"></span>
            <span>编辑${name_china}</span>
        </div>
        <a id="goBack" class="btn-return distance-left" href="javascript:;"><i class="icon icon-arrow-left"></i>返回上级</a>
    </div>
    <div class="page-title-border"></div>
</div>

<div class="search-field">
    <span class="field-cont">
        <span class="field-cont-title">用户名</span>
        <input type="text" class="summer-input" id="userNickName"/>
    </span>
    
    <span class="field-btn-wrapper">
        <a id="search" class="btn btn-primary btn-icon wave distance-right"><i class="icon icon-search"></i></a>
        <a id="reset" class="btn btn-icon wave wave-dark"><i class="icon icon-refresh"></i></a>
    </span>
</div>
<div id="t-wrap">
    <table class="summer-datagrid" id="dataList">
	    <col width="20%">
	    <col width="20%">
	    <col width="20%">
	    <col width="20%">
	    <col width="20%">
	    <col width="20%">
	    <col width="20%">
	   
	    <thead>
		    <tr>
		    	<th>用户ID</th>		        
		        <th>用户名</th>
		        <th>用户级别</th>
		        <th>用户电话</th>
		        <th>用户来源</th>
		        <th>活跃状态</th>
		        <th>总消费金额</th>
		    </tr>
	    </thead>
    </table>
</div>
<script>
    
  var   editData,
        permission = CommonUtil.getPermission('${name_english}');
  //请求url
	var CONST_URL = {
		LIST: basePath + '${common_url}list',
	   	INIT_ADD: basePath + "${common_url}initAdd",
	   	INIT_EDIT: basePath + "${common_url}initEdit",
	   	INIT_VIEW: basePath + "${common_url}initView",
	   	DEL: basePath + "${common_url}del",
	   	INIT_LEVEL: basePath + '${common_url}initLevel'
	};
  //查看
    $(function () {
    	editData = ${editData};
    	console.log(editData);
        createTable();	
		});  
    // 重新加载表格
	function reloadTable() {
		$('#dataList').datagrid('reload',{
            ajax: {
            	param: {
            		"userNickName": trimSpace($('#userNickName').val())
                	//"startTime": trimSpace($('#startTime').val()),
                	//"stopTime": trimSpace($('#stopTime').val())
            	}
            }
        });
	}
    
    //创建表格
    function createTable() {
    	$('#dataList').datagrid({
    		ajax: {
    			url: CONST_URL.INIT_LEVEL+ "?id=" + editData.id,
    			//url : CONST_URL.DEL + "?id=" + id
    			param: {
    				"userNickName": trimSpace($('#userNickName').val())
                	//"startTime": trimSpace($('#startTime').val()),
                	//"stopTime": trimSpace($('#stopTime').val())
            	}
    		},
    		columns: [
    		     {
    		    	 field: 'id',
    		    	 hidden: true
    		     },
    		     {
    		    	 field:'id'
    		     },   
    		     {
    		    	 field: 'userNickName'
    		     },
    		     {
    		    	 field:'levelDesc'
    		     },
    		     {
    		    	 field:'userPhone'
    		     },
    		     {
    		    	 field:'laiyuan'
    		     },
    		     {
    		    	 field:'isActive'
    		     },
    		     {
    		    	 field:'totalComsum'
    		     }
    		     
    	    ]
    	});
    }

</script>
</body>
</html>